import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import { ROUTE_WITH_AUTHORIZATION_LOGIN } from '@/publicConfig'
import process from './process'
import teacher from './teacher'
import learn from './learn'
import learnSquare from './learnSquare'
import studentProcess from './studentProcess'
import student from './student'
import stu from './stu'
import collect from './collect'
import notice from './notice'
//	创建路由
const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: [
		...student,
		...stu,
		...process,
		...teacher,
		...learn,
		...learnSquare,
		...studentProcess,
		...collect,
		...notice,

		{
			path: '/:pathMatch(.*)*',
			name: 'NotFound',
			component: ()=>import('@/views/login/Login.vue'),
		},
	]
})

router.beforeEach((to, from) => {
	let pathArr = to.path.split('/')
	// return checkRoute(pathArr)	//	检查是否登录
	return true;
})
export default router
